<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Module Management</title>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/type.css" />
<script type="text/javascript" src="__PUBLIC__/js/admin.js"></script>
</head>
<script>
	$(function(){
		$("select").change(function(){
			window.location.href = "__ACTION__/GoodcategoryId/" + $(this).val();
		});
	});
</script>
<body>
<br>
<br>
<form method="post"
	action="__CONTROLLER__/delSelect/GoodcategoryId/{$GoodcategoryId}">
<table class="classify_table1">
	<tr>
		<td><span class="classify_table_title">
		属性管理</span> <span
			class="classify_table_button">
		<input type="button" id="delselect_btn" value="删除">
		</span> <span class="classify_table_button">
		<button><a
			href="__CONTROLLER__/addGoodAttribute/GoodcategoryId/{$GoodcategoryId}">添加</a>
		</button>
		</span></td>
	</tr>
	<tr>
		<td>
		<table class="classify_table2">
			<tr>
				<td class="classify_thead_checkbox">
					<input type="checkbox" onclick="DoCheck()" id="allChecked"></td>
				<td class="classify_thead_title">商品分类 <select
					name="GoodcategoryId">
					<option value="0">全部</option>
					<empty name="goodcategory">
					<option value="-1">未选择</option>
					</empty>
					<foreach name="goodcategory" item="v">
					<option value="{$v.GoodcategoryId}"<eq
						name="v.GoodcategoryId" value="$GoodcategoryId">selected</eq>
					>{:str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;',$v['deep']).$v['CategoryName']}</option>
					</foreach>
				</select></td>
				<td class="classify_thead_title">属性名</td>
				<td class="classify_thead_title">默认属性值</td>
				<td class="classify_thead_title" col=>编辑</td>

			</tr>


			<foreach name="goodattribute" item="v">
			<tr>
				<td class="classify_thead_checkbox"><input type="checkbox"
					name="attributeids[]" value="{$v.GoodAttributeid}" class="choose"></td>
				<td class="classify_tbody">{$v.CategoryName}</td>
				<td class="classify_tbody">{$v.AttributeName}</td>
				<td class="classify_tbody">{$v.AttributeDefVal}</td>
				<td>
				<button><a
					href="__CONTROLLER__/modifyGoodAttribute/GoodAttributeid/{$v.GoodAttributeid}/GoodcategoryId/{$v.GoodcategoryId}">修改</a></button>
				<button><a href="#"
					onclick="del({$v.GoodAttributeid},{$v.GoodcategoryId})">删除</a></button>
				</td>

			</tr>
			</foreach>
		</table>
		</td>
	</tr>
</table>
</form>
<script>
//删除时使用
function del(obj,id) {
		if(confirm('删除属性后，各商品中的该属性也将被删除，确定删除本属性?'))
		{
			window.location.href="__CONTROLLER__/deleteGoodAttribute/GoodAttributeid/{$v.GoodAttributeid}/GoodcategoryId/{$v.GoodcategoryId}"
		}
	}
$('#delselect_btn').click(function(){
	if($(".choose:checked").length<=0){
		alert("勾选至少一个属性复选框，才能进行本操作！");
		retrun;}
	if(confirm('删除属性后，各商品中的该属性也将被删除，确定删除这些属性?'))
	{
		$('form').submit();
	}

});

</script>
</body>
</html>